﻿<controls:DialogBoxBase
        xmlns:controls="clr-namespace:SoGame.Controls"
    x:Class="SoGame.Views.GamePlaysPopup"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" >
    <controls:DialogBoxBase.Resources>

        <ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
            <WrapPanel Orientation="Horizontal" IsItemsHost="True" MaxWidth="290"/>
        </ItemsPanelTemplate>

    </controls:DialogBoxBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid Visibility="{Binding DataContext.IsEditMode, Converter={StaticResource VisibilityConverter}, ElementName=LayoutRoot}" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <TextBlock Margin="5" TextWrapping="Wrap" Text="parties" d:LayoutOverrides="Width, Height" Style="{DynamicResource MetroHeaderBold}"/>
            <ListBox ItemsSource="{Binding }" 
    			ItemsPanel="{DynamicResource ItemsPanelTemplate1}" 
    			Grid.Row="1" MaxWidth="300">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Height="Auto" Width="Auto">
                            <Grid Margin="0" Height="99" Width="99">
                                <Rectangle Fill="{DynamicResource HighlightBrush}" Width="173" Height="173" d:LayoutOverrides="VerticalMargin"/>
                                <Image Source="{Binding Photo}" VerticalAlignment="Stretch"/>
                            </Grid>
                            <StackPanel Margin="0" d:LayoutOverrides="HorizontalAlignment">
                                <TextBlock Text="{Binding Date, StringFormat=dd/MM/yy HH:mm}" Style="{DynamicResource ItemDate}"/>
                                <TextBlock Text="{Binding Game}" Style="{DynamicResource ItemTitle}"/>
                                <TextBlock Text="{Binding Score, StringFormat=Score: \{0\}}" Style="{DynamicResource ItemTitle}" Margin="0"/>
                            </StackPanel>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>

        <StackPanel Margin="10" Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="1">
            <Button Content="FERMER" IsCancel="True" Margin="10,0,0,0"/>
        </StackPanel>
    </Grid>
</controls:DialogBoxBase>